/*Do file for appendix analysis related to "Information Valence and Evaluations of 
Congress and Individual Legislators: Experimental Evidence Regarding Negativity 
Bias in Politics" */
*Legislative Studies Quarterly
*Kal Munis (University of Virginia) & Henry Ashton (University of Oklahoma)

/*Note: This .do file is associated with analyses included in the Appendix of 
the article listed at the top of this .do file. Importantly, the following 
analyses use the full complete dataset associated with our studies PRIOR to 
removing probable bots (see main article for more information). */

clear all
set scheme s1mono

cd "directory path that data is located in here"

use appendix_data_pre_bot_removal.dta
**************************************************************
* ANALYSIS * ANALYSIS * ANALYSIS * ANALYSIS * ANALYSIS * ANALYSIS *
**************************************************************


************
* Study 1
************
reg study1a i.valence##i.partymatch

reg study1b i.valence##i.partymatch

 *Interaction models
 reg study1a i.valence##ib1.partymatch
margins, dydx(valence) at(partymatch=(0(1)2)) 
marginsplot, recast(line) recastci(rarea) yline(0) ///
xlabel(0 "Opp. Party" 1 "Non-partisan" 2"Party Match") ///
 ytitle(Marginal Effects of Negative Valence on Time Until Change) ///
 xtitle("Partisanship of Candidate vis a vis Respondent") title("")

 reg study1b i.valence##ib1.partymatch
margins, dydx(valence) at(partymatch=(0(1)2)) 
marginsplot, recast(line) recastci(rarea) yline(0) ///
xlabel(0 "Opp. Party" 1 "Non-partisan" 2"Party Match") ///
 ytitle(Marginal Effects of Negative Valence on Time Until Change) ///
 xtitle("Partisanship of Congress vis a vis Respondent") title("")
*********
* Study 2
*********

reg study2a i.valence##i.partymatch 

reg study2b i.valence##i.partymatch
 
 *Interaction models
 reg study2a i.valence##ib1.partymatch
 margins, dydx(valence) at(partymatch=(0(1)2)) 
marginsplot, recast(line) recastci(rarea) yline(0) ///
xlabel(0 "Opp. Party" 1 "Non-partisan" 2"Party Match") ///
 ytitle("Marginal Effects of Neg. Valence on # of Behaviors") ///
 xtitle("Partisanship of Legislator vis a vis Respondent") title("")
 
 reg study2b i.valence##ib1.partymatch
margins, dydx(valence) at(partymatch=(0(1)2)) 
marginsplot, recast(line) recastci(rarea) yline(0) ///
xlabel(0 "Opp. Party" 1 "Non-partisan" 2"Party Match") ///
 ytitle("Marginal Effects of Neg. Valence on # of Behaviors") ///
 xtitle("Partisanship of Congress vis a vis Respondent") title("")

******
* Study 3
*******

anova study3a trivalence if partisanship==0
pwcompare i.trivalence, mcompare(tukey) effects
meansdplot study3a trivalence if partisanship==0, yline(50) outer(2) xlabel(1 "Positive" 2 "Neutral" ///
3 "Negative") ytitle(Congressman Effectiveness) ///
xtitle(Information Valence) title("Figure X. Mean Representative Effectiveness Ratings by Valence")

sum study3a if trivalence==1 & partisanship==0
sum study3a if trivalence==2 & partisanship==0
sum study3a if trivalence==3 & partisanship==0

anova study3b trivalence if partisanship==0
pwcompare i.trivalence, mcompare(tukey) effects
meansdplot study3b trivalence if partisanship==0, yline(50) outer(2) xlabel(1 "Positive" 2 "Neutral" ///
3 "Negative") ytitle(Congressional Effectiveness) ///
xtitle(Information Valence) title("Figure X. Mean Congress Effectiveness Ratings by Valence")

* ^note: sig with snk and duncan methods.

sum study3b if trivalence==1 & partisanship==0
sum study3b if trivalence==2 & partisanship==0
sum study3b if trivalence==3 & partisanship==0


